<template>
  <div id="navs">
    <!-- logo -->
    <div class="nav-wrap">
      <div class="nav-logo-wrap">
        <div class="nav-logo">
          <img src="../../assets/img/mi-logo.png" alt />
        </div>
      </div>
      <!-- 导航 -->
      <div class="nav-List-wrap">
        <el-menu class="el-menu-demo" mode="horizontal" text-color="#000">
          <el-menu-item v-for="(item,index) of navList" :key="index">{{item.name}}</el-menu-item>
        </el-menu>
      </div>
      <!-- 搜索 -->
      <div class="nav-search-wrap">
        <el-input placeholder="家电" suffix-icon="el-icon-search"></el-input>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "home",
  components: {},
  data() {
    return {
      navList: [
          {
          name: "全部商品分类",
          href: ""
        },
        {
          name: "小米手机",
          href: ""
        },
        {
          name: "Redmi",
          href: ""
        },
        {
          name: "红米",
          href: ""
        },
        {
          name: "电视",
          href: ""
        },
        {
          name: "家电",
          href: ""
        },
        {
          name: "路由器",
          href: ""
        },
        {
          name: "智能硬件",
          href: ""
        },
        {
          name: "服务",
          href: ""
        },
        {
          name: "社区",
          href: ""
        }
      ]
    };
  }
};
</script>
<style scoped>
/* 搜索框 */

#navs {
  width: 1240px;
  margin: 0 auto;
  padding: 20px 0;
}
.nav-wrap {
  display: flex;
}
/* 导航容器布局 */
.nav-logo-wrap {
  flex: 1;
}
.nav-List-wrap {
  flex: 7;
}
.nav-search-wrap {
  flex: 2;
}
/* logo */
.nav-logo {
  width: 55px;
  height: 55px;
  background: #ff6700;
}
.nav-logo img {
  height: 100%;
}
/* 导航 */
.el-menu-demo {
  border: none;
  text-align: center;
}
.el-menu-demo > .el-menu-item {
  font-size: 16px;
  padding: 0 15px;
}
</style>
<style >
.el-input__suffix{
    position: absolute;
    right: 0;
    box-sizing: border-box;
}

.el-input__suffix,
.el-input {
  height: 100%;
  padding: 8px 0;
  box-sizing: border-box;
}
.el-input__inner {
  height: 100%;
  border-radius: 0 !important;
}
.el-input__icon:hover {
    background: #ff6700;
    color: #fff;
    cursor: pointer;
}
.el-input__icon {
  width: 50px;
  font-size: 18px;
  border-left: 1px solid #ccc;
  font-weight: 900;
  color: #616161;
}
</style>